#include <bits/stdc++.h>
using namespace std;

#define int long long

const int N = 1e5 + 10;
int n, k, x, sum;
priority_queue<int> q;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> k;
    for(int i = 0; i < n; i++) {
        cin >> x;
        sum += x;
        if(x % 2 == 0) q.push(x);
    }
    while(!q.empty() && k--) {
        int tmp = q.top();
        q.pop();
        tmp /= 2;
        sum -= tmp;
        if(tmp % 2 == 0) {
            q.push(tmp);
        } 
    }

    cout << sum << endl;
    
    return 0;
}